package com.yf.dxapp.module.app.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yf.dxapp.module.app.controller.app.vo.DataResult;
import com.yf.dxapp.module.app.dal.dataobject.appuser.AppUserDO;
import com.yf.dxapp.module.app.service.appuser.AppUserService;
import jakarta.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @author yxmds
 */
public abstract class ApiAppBaseController {

    @Resource
    private AppUserService appUserService;

    public AppUserDO getLoginUser(Long loginUserId) {
        return appUserService.getAppUser(loginUserId);
    }


    public CommonResult jsonDataResult(String json) {
        return success(new DataResult(true, json, true));
    }

    public CommonResult dataResult(Object o) {
        return success(new DataResult(true, o));
    }
}
